package com.ruoyi.project.mydy.orderrecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.orderrecord.mapper.DlOrderRecordMapper;
import com.ruoyi.project.mydy.orderrecord.domain.DlOrderRecord;
import com.ruoyi.project.mydy.orderrecord.service.IDlOrderRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 订单记录Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlOrderRecordServiceImpl implements IDlOrderRecordService 
{
    @Autowired
    private DlOrderRecordMapper dlOrderRecordMapper;

    /**
     * 查询订单记录
     * 
     * @param id 订单记录主键
     * @return 订单记录
     */
    @Override
    public DlOrderRecord selectDlOrderRecordById(Long id)
    {
        return dlOrderRecordMapper.selectDlOrderRecordById(id);
    }

    /**
     * 查询订单记录列表
     * 
     * @param dlOrderRecord 订单记录
     * @return 订单记录
     */
    @Override
    public List<DlOrderRecord> selectDlOrderRecordList(DlOrderRecord dlOrderRecord)
    {
        return dlOrderRecordMapper.selectDlOrderRecordList(dlOrderRecord);
    }

    /**
     * 新增订单记录
     * 
     * @param dlOrderRecord 订单记录
     * @return 结果
     */
    @Override
    public int insertDlOrderRecord(DlOrderRecord dlOrderRecord)
    {
        dlOrderRecord.setCreateTime(DateUtils.getNowDate());
        return dlOrderRecordMapper.insertDlOrderRecord(dlOrderRecord);
    }

    /**
     * 修改订单记录
     * 
     * @param dlOrderRecord 订单记录
     * @return 结果
     */
    @Override
    public int updateDlOrderRecord(DlOrderRecord dlOrderRecord)
    {
        return dlOrderRecordMapper.updateDlOrderRecord(dlOrderRecord);
    }

    /**
     * 批量删除订单记录
     * 
     * @param ids 需要删除的订单记录主键
     * @return 结果
     */
    @Override
    public int deleteDlOrderRecordByIds(String ids)
    {
        return dlOrderRecordMapper.deleteDlOrderRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单记录信息
     * 
     * @param id 订单记录主键
     * @return 结果
     */
    @Override
    public int deleteDlOrderRecordById(Long id)
    {
        return dlOrderRecordMapper.deleteDlOrderRecordById(id);
    }
}
